Conditions | 2 |
Total Lines | 15 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { |
||
27 | |||
28 | @Post() |
||
29 | @Roles(UserRole.PHOTOGRAPHER) |
||
30 | @ApiOperation({ summary: 'Create new shipping cost' }) |
||
31 | public async index(@Body() dto: ShippingCostDTO) { |
||
32 | const { weight, price } = dto; |
||
33 | |||
34 | try { |
||
35 | const id = await this.commandBus.execute( |
||
36 | new CreateShippingCostCommand(weight, price) |
||
37 | ); |
||
38 | |||
39 | return { id }; |
||
40 | } catch (e) { |
||
41 | throw new BadRequestException(e.message); |
||
42 | } |
||
45 |